package com.wps.wdztv6.domain.edit;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.wps.wdztv6.domain.WdztResult;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Builder
@Getter
@Setter
@ToString
public class FileInfoCallback{
	@JSONField(name = "file")
    private FileMeta file;
        
    @JSONField(name = "user")
    private User user;
	
	@Getter
	@Setter
	@ToString
	@Builder
	public static class FileMeta {
	    
	    @JSONField(name = "id")
	    private String id;
	    
	    @JSONField(name = "name")
	    private String name;
	    
	    @JSONField(name = "version")
	    private int version;
	    
	    @JSONField(name = "size")
	    private long size;
	    
	    @JSONField(name = "creator")
	    private String creator;
	    
	    @JSONField(name = "create_time")
	    private long createTime;
	    
	    @JSONField(name = "modifier")
	    private String modifier;
	    
	    @JSONField(name = "modify_time")
	    private long modifyTime;
	    
	    @JSONField(name = "download_url")
	    private String downloadUrl;
	    
	    @JSONField(name = "preview_pages")
	    private int preview_pages;

		@JSONField(name = "readonly")
		private boolean readonly;

		// 用户权限，非必填
		@JSONField(name = "user_acl", serialzeFeatures= {SerializerFeature.WriteMapNullValue})
	    private UserAccessControlList userAcl;

		// 水印，非必填
	    @JSONField(name = "watermark", serialzeFeatures= {SerializerFeature.WriteMapNullValue})
	    private Watermark watermark;

		@Getter
		@Setter
		@ToString
		@Builder
		public static class UserAccessControlList {

			@JSONField(name = "rename")
		    private int rename;

			@JSONField(name = "history")
		    private int history;

			@JSONField(name = "copy")
		    private int copy;

		    @JSONField(name = "export")
		    private int export;

		    @JSONField(name = "print")
		    private int print;
		}

		@Getter
		@Setter
		@Builder
		@ToString
		public static class Watermark {
		       
		    @JSONField(name = "type")
		    private int type;
		    
		    @JSONField(name = "value")
		    private String value;
		    
		    @JSONField(name = "fillstyle")
		    private String fillstyle;
		    
		    @JSONField(name = "font")
		    private String font;
		    
		    @JSONField(name = "rotate")
		    private Long rotate;
		    
		    @JSONField(name = "horizontal")
		    private Long horizontal;
		    
		    @JSONField(name = "vertical")
		    private Long vertical;
		}
	    
	}

	@Getter
	@Setter
	@Builder
	@ToString
	public static class User {
		@JSONField(name = "id")
	    private String id;
		
		@JSONField(name = "name")
	    private String name;
		
		@JSONField(name = "permission")
	    private String permission;
		
		@JSONField(name = "avatar_url")
	    private String avatarUrl;
	}
}
